<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="在生产环境开启或关闭日志备份开关">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="TiDB_00072">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>在生产环境开启或关闭日志备份开关</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="TiDB_00072"></a><a name="TiDB_00072"></a>

<h1 class="topictitle1">在生产环境开启或关闭日志备份开关</h1>
<div><div class="section"><h4 class="sectiontitle">操作步骤</h4><ol><li><span>登录TiUP节点。</span></li><li><span>执行以下命令开启或关闭日志备份开关（“172.0.0.0:80”为PD节点的IP和端口，“local:///test/bkpbinlog0000/”为存放日志备份文件的目录绝对路径，用户请根据实际情况输入）。</span><p><div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><ul><li>请确保在TiUP、TiKV节点上（如果TiDB集群下存在TiFlash节点，也包括TiFlash节点），TiDB集群具有存放日志备份文件的目录路径的读写权限。</li><li>打开日志备份开关前，需确保存放日志备份文件的目录在TiUP、TiKV（如果TiDB集群下存在TiFlash节点，TiFlash节点的此目录绝对路径也需要一致）节点的绝对路径一致且该目录为空。</li></ul>
</div></div>
<ul><li>开启日志备份开关。<pre class="screen">tiup br log start --task-name=pitr --pd <em>172.0.0.0:80</em> --storage <em>"local:///</em><em>test/bkpbinlog0000</em><em>/"</em></pre>
</li><li>关闭日志备份开关。<pre class="screen">tiup br log stop --task-name=pitr --pd <em>172.0.0.0:80</em> </pre>
</li></ul>
</p></li><li><span>执行以下命令查询日志备份开关当前状态（<strong><em>172.0.0.0:80</em></strong>为PD节点的IP和端口）。</span><p><pre class="screen">tiup br log status --task-name=pitr --pd <em>172.0.0.0:80</em> </pre>
</p></li></ol>
</div>
<p></p>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>